# -*-coding:utf-8-*-
import sys
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship
from props.sql_connect import Base

reload(sys)
sys.setdefaultencoding('utf-8')


class tag(Base):
    __tablename__ = 'book_tag'
    tag_id = Column(Integer, primary_key=True)
    tag_name = Column(String(32))
    tag_level = Column(Integer)
    father_tag_id = Column(Integer)

    # ref_book = relationship('book_tag')

    def __init__(self, name, level, father):
        self.tag_name = name
        self.tag_level = level
        self.father_tag_id = father

    def __repr__(self):
        return '**COUNT**' + self.tag_name+ '_level:'+ str(self.tag_level)
